/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import {
    global,
    passNode,
    passNodeArray,
    unpackNonNullableNode,
    unpackNode,
    unpackNodeArray,
    assertValidPeer,
    AstNode,
    Es2pandaAstNodeType,
    KNativePointer
} from "../../reexport-for-generated"

import { TypeNode } from "./TypeNode"
import { TSTypeParameterDeclaration } from "./TSTypeParameterDeclaration"
import { Expression } from "./Expression"
import { TSInterfaceDeclaration } from "./TSInterfaceDeclaration"
import { Es2pandaScriptFunctionFlags } from "./../Es2pandaEnums"
export class ETSFunctionType extends TypeNode {
     constructor(pointer: KNativePointer) {
        assertValidPeer(pointer, 66)
        super(pointer)
        console.warn("Warning: stub node ETSFunctionType")
    }
    get typeParamsConst(): TSTypeParameterDeclaration | undefined {
        return unpackNode(global.generatedEs2panda._ETSFunctionTypeIrTypeParamsConst(global.context, this.peer))
    }
    get typeParams(): TSTypeParameterDeclaration | undefined {
        return unpackNode(global.generatedEs2panda._ETSFunctionTypeIrTypeParams(global.context, this.peer))
    }
    get paramsConst(): readonly Expression[] {
        return unpackNodeArray(global.generatedEs2panda._ETSFunctionTypeIrParamsConst(global.context, this.peer))
    }
    get returnTypeConst(): TypeNode | undefined {
        return unpackNode(global.generatedEs2panda._ETSFunctionTypeIrReturnTypeConst(global.context, this.peer))
    }
    get returnType(): TypeNode | undefined {
        return unpackNode(global.generatedEs2panda._ETSFunctionTypeIrReturnType(global.context, this.peer))
    }
    get functionalInterface(): TSInterfaceDeclaration | undefined {
        return unpackNode(global.generatedEs2panda._ETSFunctionTypeIrFunctionalInterface(global.context, this.peer))
    }
    get functionalInterfaceConst(): TSInterfaceDeclaration | undefined {
        return unpackNode(global.generatedEs2panda._ETSFunctionTypeIrFunctionalInterfaceConst(global.context, this.peer))
    }
    get flags(): Es2pandaScriptFunctionFlags {
        return global.generatedEs2panda._ETSFunctionTypeIrFlags(global.context, this.peer)
    }
    get isThrowingConst(): boolean {
        return global.generatedEs2panda._ETSFunctionTypeIrIsThrowingConst(global.context, this.peer)
    }
    get isRethrowingConst(): boolean {
        return global.generatedEs2panda._ETSFunctionTypeIrIsRethrowingConst(global.context, this.peer)
    }
    get isExtensionFunctionConst(): boolean {
        return global.generatedEs2panda._ETSFunctionTypeIrIsExtensionFunctionConst(global.context, this.peer)
    }
}
export function isETSFunctionType(node: AstNode): node is ETSFunctionType {
    return node instanceof ETSFunctionType
}